package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        System.out.println(main);
        doSome();

    }
    public static void doSome(){
        Thread t = Thread.currentThread();
        System.out.println("运行doSome方法的线程:"+t);

        System.out.println("线程的名字:"+t.getName());//main
        System.out.println("线程的唯一标识:"+t.getId());//1
        System.out.println("线程的优先级:"+t.getPriority());//5

        System.out.println("线程是否活着:"+t.isAlive());//true
        System.out.println("线程是否为守护线程:"+t.isDaemon());//false
        System.out.println("线程是否被中断:"+t.isInterrupted());//false

    }
}


